{% extends '__base.tpl' %}
{% block head %}
{{ super() }}
<!-- build:css -->
<link rel="stylesheet" href="../../../public/css/other/wangEditor.css">
<link rel="stylesheet" href="../../../public/css/other/wangEditor-extend.css">
<link rel="stylesheet" type="text/css" href="../../../public/css/page/popup.css" />
<link rel="stylesheet" type="text/css" href="../../../public/css/page/answer.css" />
<!-- endbuild -->
{% endblock %}

{% block middle %}
<div id='middle' data-uptype="sourceCode" >
    <!--主导航-->
    <div class="nav category">
        <div class="hot-nav">
            <a {% if data.parentId==''%} class="hover" {% endif %}
               href='/source.html'>全部</a>
        </div>
        <ul class="clearfix main-ul">
            {% for item in data.category %}
            <li>
                <a {% if data.parentId == item.id %} class="hover" {% endif %}
                   href='/source.html?parentId={{item.id}}'>{{ item.name }}</a>
            </li>
            {% endfor %}
        </ul>
    </div>
    <!--子导航-->
    <div class="hide" {% if data.parentId %} style="display:block;" {% endif %}>
        <div class="nav sub-nav category">
            {% for item in data.category %}
            <ul class="hide clearfix" {% if data.parentId==item.child[0].parentId %} style="display:block;" {% endif %}>
                <li>
                    <a href='/source.html?parentId={{item.child[0].parentId}}'
                       {% if data.categoryId==data.parentId and (data.parentId == item.child[0].parentId) %} class="hover" {% endif %}>
                        全部
                    </a>
                </li>
                {% for child in item.child %}
                <li>
                    <a {% if data.categoryId == child.id %} class="hover" {% endif %}
                       href='/source.html?parentId={{child.parentId}}&categoryId={{child.id}}'>
                        {{ child.name }}
                    </a>
                </li>
                {% endfor %}
            </ul>
            {% endfor %}
            <!-- <span class="more">更多</span>-->
        </div>
    </div>

    <div class="putQuestions" style="margin-top:5px;" onclick="BASE.SOURCE.showPopup(this)">
        我要发布...
        <button class="blue-change-btn common-btn">
            <img src="../../../public/images/pen.png" class="vmiddle" alt="pen">
            发布
        </button>
    </div>
    <!------------------列表start---------------------------------->
    <div class="listCon" id="middleListContent">
        <ul class="content ">
            {%if data.list.list.length>0%}
            {% for item in data.list.list %}
            <li>
                {%if (item.covers|imgArrarys).length > 1 %}
                <h3 class="title">
                    <a target="_blank" href="/{{item.id}}/source_content.html">
                        {%if item.topIs%}
                        <i class="icon-top-is">置顶</i>
                        {%endif%}
                        {{item.title|safe}}
                        {%if item.price >0%}
                        <span class="red font13">{{item.supportPays|supportPays}}{{item.price}}</span>
                        {%else%}
                        <span class="green font13">免费</span>
                        {%endif%}
                    </a>
                </h3>
                {%endif%}
                {%if (item.covers|imgArrarys).length ==1 %}
                <div class="listConLeft">
                    <a target="_blank" href="/{{item.id}}/source_content.html">
                        <img class="content-img" src="{{item.covers|imgPath}}">
                    </a>
                </div>
                {%elif (item.covers|imgArrarys).length > 1 %}
                <div class="content-img-box">
                    <a target="_blank" href="/{{item.id}}/source_content.html">
                        {% for img in (item.covers|imgArrarys)%}
                        <img class="content-img" src="{{img|imgPath}}">
                        {%endfor%}
                    </a>
                </div>
                {%endif%}
                <div {%if (item.covers|imgArrarys).length ==1%} class="listConRight" {%endif%}>
                    {%if (item.covers|imgArrarys).length <= 1 %}
                    <h3 class="title">
                        <a target="_blank" href="/{{item.id}}/source_content.html">
                            {%if item.topIs%}
                            <i class="icon-top-is">置顶</i>
                            {%endif%}
                            {{item.title|safe}}
                            {%if item.price >0%}
                            <span class="red font13">{{item.supportPays|supportPays}}{{item.price}}</span>
                            {%else%}
                            <span class="green font13">免费</span>
                            {%endif%}
                        </a>
                    </h3>
                    {%endif%}
                    <div class="desc">
                        <a target="_blank" href="/{{item.memberId}}/userInfo.html">
                            {%if item.memberId %}
                            <img src="{{item.header|imgPath}}" class="userImg" />
                            {%endif%}
                            {{item.nickName}}
                        </a>
                        · {{item.clickCount}}浏览
                        · {{item.commentCount}}评论
                        · {{item.createDateTime|toTimeStr}}
                    </div>
                </div>
            </li>
            {%endfor%}
            {% else %}
            <li class="no-data">
                {% include '__no_data.html' %}
            </li>
            {%endif%}
        </ul>
        <div class="loading">正在加载中...</div>
        <div class="nomore-data">---到底了---</div>
    </div>
    <script id="middleListContent_tpl" type="text/html">
        <% each data as item i %>
        <li>
            {%include '__source_script.html'%}
        </li>
        <%/each%>
    </script>
    <!------------------列表end---------------------------------->
</div>
{% endblock %}

{% block right %}
<!--右侧板块-->
{% include '__indexRight_memberCard.html' %}
{% include '__indexRight_search.html' %}
{% include '__indexRight_daren.html' %}
{% endblock %}

{% block footer %}
{{ super() }}
{% include '__popup_source.html' %}
{% endblock %}

{% block script %}
{{ super() }}
<!-- build:js -->
<script src="../../../public/js/page/plugin/wangEditor.js"></script>
<script src="../../../public/js/page/plugin/wangEditor-extentd.js"></script>
<script src='../../../public/js/page/common/uploadAnswer.js'></script>
<script src='../../../public/js/page/common/popup.js'></script>
<script src='../../../public/js/page/source/source_common.js'></script>
<script src='../../../public/js/page/source/source.js'></script>
<!-- endbuild -->
{% endblock %}